---
id: cli-all
title: CLI Commands
---

# CLI Reference

Commands that are marked as workspace only must be executed inside a workspace. Commands that are marked as not workspace only, can be executed from anywhere and will run on a remote server.

## add

**Alias**: `a`  
**Workspace only**: yes  
**Description**: add any subset of files to be tracked as a component(s)  
 all flags support glob patterns and {PARENT} {FILE_NAME} annotations  
 https://bit.dev/reference/components/adding-components

`bit add [path...]`

| **Option**                         | **Option alias** | **Description**                                                                          |
| ---------------------------------- | :--------------: | ---------------------------------------------------------------------------------------- |
| `--id <name>`                      |       `-i`       | manually set component id                                                                |
| `--main <file>`                    |       `-m`       | define entry point for the components                                                    |
| `--tests <file>/"<file>,<file>"`   |       `-t`       | specify test files to track. use quotation marks to list files or use a glob pattern     |
| `--namespace <namespace>`          |       `-n`       | organize component in a namespace                                                        |
| `--exclude <file>/"<file>,<file>"` |       `-e`       | exclude file from being tracked. use quotation marks to list files or use a glob pattern |
| `--override <boolean>`             |       `-o`       | override existing component if exists (default = false)                                  |

---

## app

**Workspace only**: yes  
**Description**: manage applications

`bit app <sub-command>`

### app list

**Usage**: `app list`

**Description**: list all registered applications

| **Option** | **Option alias** | **Description**                          |
| ---------- | :--------------: | ---------------------------------------- |
| `--json`   |       `-j`       | return the component data in json format |

---

## artifacts

**Workspace only**: yes  
**Description**: EXPERIMENTAL. list and download components artifacts.  
artifacts are created on isolated capsules during tag or snap commands.  
example of artifacts are dists files generated by a compiler, a JUnit.xml file generated by a tester  
and a package.tgz file generated by pkg aspect.

`bit artifacts <pattern...>`

| **Option**             | **Option alias** | **Description**                                                                                          |
| ---------------------- | :--------------: | -------------------------------------------------------------------------------------------------------- |
| `--aspect <aspect-id>` |                  | show/download only artifacts generated by this aspect-id                                                 |
| `--task <task-id>`     |                  | show/download only artifacts generated by this task-id                                                   |
| `--files <glob>`       |                  | show/download only artifacts matching the given files or the glob pattern (wrap glob patterns in quotes) |
| `--out-dir <string>`   |                  | download the files to the specified dir                                                                  |

---

## aspect

**Workspace only**: yes  
**Description**: EXPERIMENTAL. manage aspects

`bit aspect <sub-command>`

### aspect list

**Usage**: `aspect list [pattern]`

**Description**: list all aspects configured on component(s)  
you can use a `<pattern>` for multiple component ids, such as `bit aspect list "org.scope/utils/**"`. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button"  
always wrap the pattern with quotes to avoid collision with shell commands.  
to validate the pattern before running this command, run `bit pattern <pattern>`.

| **Option** | **Option alias** | **Description**                                   |
| ---------- | :--------------: | ------------------------------------------------- |
| `--debug`  |       `-d`       | show the origins were the aspects were taken from |

### aspect get

**Usage**: `aspect get <component-id>`

**Description**: show aspects' data and configuration of the given component

| **Option** | **Option alias** | **Description**                                   |
| ---------- | :--------------: | ------------------------------------------------- |
| `--debug`  |       `-d`       | show the origins were the aspects were taken from |
| `--json`   |       `-j`       | format as json                                    |

### aspect set

**Usage**: `aspect set <pattern> <aspect-id> [config]`

**Description**: set an aspect to component(s) with optional config.  
enter the config as stringified JSON (e.g. '{"foo":"bar"}' ).  
if no config entered, the aspect will be set with empty config ({}).  
you can use a `<pattern>` for multiple component ids, such as `bit aspect set "org.scope/utils/**"`. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button"  
always wrap the pattern with quotes to avoid collision with shell commands.  
to validate the pattern before running this command, run `bit pattern <pattern>`.

### aspect unset

**Usage**: `aspect unset <pattern> <aspect-id>`

**Description**: unset an aspect from component(s).  
you can use a `<pattern>` for multiple component ids, such as `bit aspect unset "org.scope/utils/**"`. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button"  
always wrap the pattern with quotes to avoid collision with shell commands.  
to validate the pattern before running this command, run `bit pattern <pattern>`.

### aspect update

**Usage**: `aspect update <aspect-id> [pattern]`

**Description**: update a version of an aspect  
default to all components using the aspect, unless "pattern" is provided.  
you can use a `<pattern>` for multiple component ids, such as `bit aspect update <aspect-id> "org.scope/utils/**"`. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button"  
always wrap the pattern with quotes to avoid collision with shell commands.  
to validate the pattern before running this command, run `bit pattern <pattern>`.

examples:  
"bit aspect update scope.org/aspect '**/ui/**'" - update "ui" components that use scope.org/aspect to the latest version  
"bit aspect update scope.org/aspect@2.0.0" - updates all components using scope.org/aspect to version 2.0.0.

---

## build

**Workspace only**: yes  
**Description**: run set of tasks for build

`bit build [pattern]`

| **Option**                                                                                                  | **Option alias** | **Description**                                                                                 |
| ----------------------------------------------------------------------------------------------------------- | :--------------: | ----------------------------------------------------------------------------------------------- |
| `--all`                                                                                                     |       `-a`       | build all components, not only modified and new                                                 |
| `--dev`                                                                                                     |       `-d`       | run the pipeline in dev mode                                                                    |
| `--install`                                                                                                 |                  | install core aspects in capsules                                                                |
| `--reuse-capsules`                                                                                          |                  | avoid deleting the capsules root-dir before starting the build                                  |
| `--tasks <string>`                                                                                          |                  | build the specified task(s) only. for multiple tasks, separate by a comma and wrap with quotes. |
| specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. teambit.compilation/compiler) |
| `--cache-packages-on-capsule-root`                                                                          |                  | set the package-manager cache on the capsule root                                               |
| `--list-tasks <string>`                                                                                     |                  | list tasks of an env or a component-id for each one of the pipelines: build, tag and snap       |

---

## capsule

**Workspace only**: yes  
**Description**: manage capsules.  
a capsule is a directory contains the component code, isolated from the workspace.  
normally, capsules are created during the build process, the component files are copied and the packages are installed  
via the configured package-manager. the purpose is to compile/test them in isolation to make sure they will work for  
other users after publishing/exporting them.

`bit capsule <sub-command>`

### capsule list

**Usage**: `capsule list`

**Description**: list all capsules

| **Option** | **Option alias** | **Description** |
| ---------- | :--------------: | --------------- |
| `--json`   |       `-j`       | json format     |

### capsule create

**Usage**: `capsule create [componentIds...]`

**Description**: create capsules

| **Option**                 | **Option alias** | **Description**                                                                                         |
| -------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------- |
| `--base-dir <name>`        |       `-b`       | set base dir of all capsules (hashed to create the base dir inside the root dir - host path by default) |
| `--root-base-dir <name>`   |       `-r`       | set root base dir of all capsules (absolute path to use as root dir)                                    |
| `--always-new`             |       `-a`       | create new environment for capsule                                                                      |
| `--seeders-only`           |       `-s`       | create capsules for the seeders only (not for the entire graph)                                         |
| `--id <name>`              |       `-i`       | reuse capsule of certain name                                                                           |
| `--json`                   |       `-j`       | json format                                                                                             |
| `--install-packages`       |       `-d`       | install packages by the package-manager                                                                 |
| `--package-manager <name>` |       `-p`       | npm, yarn or pnpm, default to npm                                                                       |

### capsule delete

**Usage**: `capsule delete`

**Description**: delete capsules. with no args, only workspace's capsules are deleted

| **Option**        | **Option alias** | **Description**                                   |
| ----------------- | :--------------: | ------------------------------------------------- |
| `--scope-aspects` |                  | delete scope-aspects capsules                     |
| `--all`           |       `-a`       | delete all capsules for all workspaces and scopes |

---

## check-types

**Workspace only**: yes  
**Description**: check typescript types

`bit check-types [pattern]`

| **Option** | **Option alias** | **Description**                                           |
| ---------- | :--------------: | --------------------------------------------------------- |
| `--all`    |       `-a`       | check-types for all components, not only modified and new |
| `--strict` |                  | in case issues found, exit with code 1                    |

---

## checkout

**Alias**: `U`  
**Workspace only**: yes  
**Description**: switch between component versions or remove local changes  
 `bit checkout <version> [ids...]` => checkout the specified ids (or all components when --all is used) to the specified version  
 `bit checkout latest [ids...]` => checkout the specified ids (or all components when --all is used) to their latest versions  
 `bit checkout [ids...] --reset` => remove local modifications from the specified ids (or all components when --all is used)  
 you can use a pattern for multiple ids, such as bit checkout 0.0.1 "utils/\*". (wrap the pattern with quotes to avoid collision with shell commands)

`bit checkout [values...]`

| **Option**                       | **Option alias** | **Description**                                                                                                                                   |
| -------------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--interactive-merge`            |       `-i`       | when a component is modified and the merge process found conflicts, display options to resolve them                                               |
| `--ours`                         |       `-o`       | in case of a conflict, override the used version with the current modification                                                                    |
| `--theirs`                       |       `-t`       | in case of a conflict, override the current modification with the specified version                                                               |
| `--manual`                       |       `-m`       | in case of a conflict, leave the files with a conflict state to resolve them manually later                                                       |
| `--reset`                        |       `-r`       | remove local changes                                                                                                                              |
| `--all`                          |       `-a`       | all components                                                                                                                                    |
| `--verbose`                      |       `-v`       | showing verbose output for inspection                                                                                                             |
| `--skip-npm-install`             |                  | DEPRECATED. use "--skip-dependency-installation" instead                                                                                          |
| `--skip-dependency-installation` |                  | do not install packages of the imported components                                                                                                |
| `--ignore-package-json`          |                  | do not generate package.json for the imported component(s). (it automatically enables skip-npm-install and save-dependencies-as-components flags) |
| `--conf [path]`                  |                  | write the configuration file (bit.json) and the envs configuration files (use --conf without path to write to the default dir)                    |
| `--ignore-dist`                  |                  | do not write dist files (when exist)                                                                                                              |

---

## clear-cache

**Alias**: `cc`  
**Workspace only**: no  
**Description**: clears Bit's cache from current working machine  
The following gets removed by this command:

1. V8 compiled code (generated the first time Bit is loaded by v8-compile-cache package)
2. components cache on the filesystem (mainly the dependencies graph and reference)
3. scope's index file, which maps the component-id:object-hash  
   https://bit.dev/reference/workspace/clearing-cache

`bit clear-cache`

| **Option**               | **Option alias** | **Description**                        |
| ------------------------ | :--------------: | -------------------------------------- |
| `--remote <remote-name>` |       `-r`       | clear memory cache from a remote scope |

---

## cli

**Workspace only**: yes  
**Description**: EXPERIMENTAL. enters bit cli program and generates commands list

`bit cli`

### cli generate

**Usage**: `cli generate`

**Description**: EXPERIMENTAL. generate an .md file with all commands details

| **Option**   | **Option alias** | **Description**                                                                                                                |
| ------------ | :--------------: | ------------------------------------------------------------------------------------------------------------------------------ |
| `--metadata` |                  | metadata/front-matter to place at the top of the .md file, enter as an object e.g. --metadata.id=cli --metadata.title=commands |

---

## compile

**Workspace only**: yes  
**Description**: compile components in the development workspace

`bit compile [component...]`

| **Option**          | **Option alias** | **Description**                                               |
| ------------------- | :--------------: | ------------------------------------------------------------- |
| `--changed`         |       `-c`       | compile only new and modified components                      |
| `--verbose`         |       `-v`       | show more data, such as, dist paths                           |
| `--json`            |       `-j`       | return the compile results in json format                     |
| `--delete-dist-dir` |       `-d`       | delete existing dist folder before writing new compiled files |

---

## completion

**Workspace only**: yes  
**Description**: enable bash/zsh-completion shortcuts for commands and options

`bit completion`

---

## component-issues

**Workspace only**: yes  
**Description**: list available component-issues

`bit component-issues`

| **Option** | **Option alias** | **Description** |
| ---------- | :--------------: | --------------- |
| `--json`   |       `-j`       | json format     |

---

## config

**Workspace only**: yes  
**Description**: global config management.  
 https://bit.dev/reference/config/bit-config

`bit config`

### config set

**Usage**: `config set <key> <val>`

**Description**: set a global configuration

### config del

**Usage**: `config del <key>`

**Description**: delete given key from global configuration

### config get

**Usage**: `config get <key>`

**Description**: get a global configuration

### config list

**Usage**: `config list`

**Description**: list all configuration(s)

---

## create

**Workspace only**: yes  
**Description**: create a new component from a template

`bit create <templateName> <componentNames...>`

| **Option**             | **Option alias** | **Description**                                                                     |
| ---------------------- | :--------------: | ----------------------------------------------------------------------------------- |
| `--namespace <string>` |       `-n`       | sets the component's namespace and nested dirs inside the scope                     |
| `--scope <string>`     |       `-s`       | sets the component's scope-name. if not entered, the default-scope will be used     |
| `--aspect <string>`    |       `-a`       | aspect-id of the template. helpful when multiple aspects use the same template name |
| `--path <string>`      |       `-p`       | relative path in the workspace. by default the path is `<scope>/<namespace>/<name>` |
| `--env <string>`       |       `-e`       | set the component's environment. (overrides the env from variants and the template) |

---

## dependencies

**Workspace only**: yes  
**Description**: EXPERIMENTAL. show dependencies (direct and indirect) of the given component

`bit dependencies <id>`

| **Option** | **Option alias** | **Description**                                                      |
| ---------- | :--------------: | -------------------------------------------------------------------- |
| `--debug`  |       `-d`       | show the immediate dependencies and how their version was determined |

---

## dependents

**Workspace only**: yes  
**Description**: EXPERIMENTAL. show dependents of the given component

`bit dependents <id>`

---

## deprecate

**Alias**: `d`  
**Workspace only**: no  
**Description**: deprecate a component

`bit deprecate <id>`

| **Option**          | **Option alias** | **Description**                                              |
| ------------------- | :--------------: | ------------------------------------------------------------ |
| `--new-id <string>` |                  | if replaced by another component, enter the new component id |

---

## diff

**Workspace only**: yes  
**Description**: show diff between components files  
 bit diff => compare all modified components to their model version  
 bit diff [ids...] => compare the specified components against their modified states  
 bit diff [id] [version] => compare the specified version to used or modified files  
 bit diff [id] [version] [to_version] => compare the specified version files to to_version files  
 you can use a pattern for multiple ids, such as bit diff "utils/\*". (wrap the pattern with quotes to avoid collision with shell commands)

`bit diff [values...]`

| **Option**  | **Option alias** | **Description**                                         |
| ----------- | :--------------: | ------------------------------------------------------- |
| `--verbose` |       `-v`       | show a more verbose output when possible                |
| `--table`   |       `-t`       | show tables instead of plain text for dependencies diff |

---

## doctor

**Workspace only**: yes  
**Description**: diagnose a bit workspace

`bit doctor [diagnosis-name]`

| **Option**          | **Option alias** | **Description**                 |
| ------------------- | :--------------: | ------------------------------- |
| `--json`            |       `-j`       | return diagnoses in json format |
| `--list`            |                  | list all available diagnoses    |
| `--save [filePath]` |       `-s`       | save diagnoses to a file        |

---

## eject

**Alias**: `E`  
**Workspace only**: yes  
**Description**: replaces the components from the local scope with the corresponding packages  
you can use a `<pattern>` for multiple component ids, such as `bit eject "org.scope/utils/**"`. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button"  
always wrap the pattern with quotes to avoid collision with shell commands.  
to validate the pattern before running this command, run `bit pattern <pattern>`.

`bit eject <pattern>`

| **Option**     | **Option alias** | **Description**                                                                   |
| -------------- | :--------------: | --------------------------------------------------------------------------------- |
| `--force`      |       `-f`       | ignore local version. remove the components even when they are staged or modified |
| `--json`       |       `-j`       | print the results in JSON format                                                  |
| `--keep-files` |                  | keep the component files in the workspace intact                                  |

---

## eject-conf

**Workspace only**: yes  
**Description**: eject components configuration (create a `component.json` file)  
you can use a `<pattern>` for multiple component ids, such as `bit eject-conf "org.scope/utils/**"`. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button"  
always wrap the pattern with quotes to avoid collision with shell commands.  
to validate the pattern before running this command, run `bit pattern <pattern>`.

`bit eject-conf <pattern>`

| **Option**    | **Option alias** | **Description**                        |
| ------------- | :--------------: | -------------------------------------- |
| `--propagate` |       `-p`       | mark propagate true in the config file |
| `--override`  |       `-o`       | override file if exist                 |

---

## envs

**Alias**: `env`  
**Workspace only**: yes  
**Description**: list all components envs

`bit envs`

### envs list

**Usage**: `envs list`

**Description**: list all envs available in the workspace

### envs get

**Usage**: `envs get <name>`

**Description**: show component's env details

### envs set

**Usage**: `envs set <pattern> <env>`

**Description**: set an environment for component(s)  
you can use a `<pattern>` for multiple component ids, such as `bit env set "org.scope/utils/**"`. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button"  
always wrap the pattern with quotes to avoid collision with shell commands.  
to validate the pattern before running this command, run `bit pattern <pattern>`.

### envs unset

**Usage**: `envs unset <component>`

**Description**: unset an environment from component(s)  
you can use a `<pattern>` for multiple component ids, such as `bit env unset "org.scope/utils/**"`. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button"  
always wrap the pattern with quotes to avoid collision with shell commands.  
to validate the pattern before running this command, run `bit pattern <pattern>`.

### envs replace

**Usage**: `envs replace <old-env> <new-env>`

**Description**: replace an existing env with another env for all components using the old env

---

## export

**Alias**: `e`  
**Workspace only**: yes  
**Description**: export components to a remote scope.  
bit export => export all staged components to their current scope, if checked out to a lane, export the lane as well  
`bit export [id...]` => export the given ids to their current scope

https://bit.dev/reference/components/exporting-components  
you can use a pattern for multiple ids, such as bit export remote-scope "utils/\*". (wrap the pattern with quotes to avoid collision with shell commands)

`bit export [remote] [id...]`

| **Option**                   | **Option alias** | **Description**                                                                                                                         |
| ---------------------------- | :--------------: | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--eject`                    |       `-e`       | replaces the exported components from the local scope with the corresponding packages                                                   |
| `--all`                      |       `-a`       | export all components include non-staged                                                                                                |
| `--include-dependencies`     |       `-d`       | LEGACY ONLY. include the component's dependencies as part of the export to the remote scope                                             |
| `--set-current-scope`        |       `-s`       | LEGACY ONLY. ensure the component's remote scope is set according to the target location                                                |
| `--rewire`                   |       `-r`       | LEGACY ONLY. when exporting to a different or new scope, replace import/require statements in the source code to match the new scope    |
| `--force`                    |       `-f`       | force changing a component remote without asking for a confirmation                                                                     |
| `--all-versions`             |                  | export not only staged versions but all of them                                                                                         |
| `--origin-directly`          |                  | HARMONY ONLY. avoid export to the central hub, instead, export directly to the original scopes. not recommended!                        |
| `--resume <string>`          |                  | in case the previous export failed and suggested to resume with an export-id, enter the id                                              |
| `--ignore-missing-artifacts` |                  | EXPERIMENTAL. don't throw an error when artifact files are missing. not recommended, unless you're sure the artifacts are in the remote |

---

## fork

**Workspace only**: no  
**Description**: EXPERIMENTAL. create a new component out of an existing one  
note that [target-name] is the name only without the scope.  
to set the default-scope, please use --scope flag

`bit fork <source-id> [target-name]`

| **Option**         | **Option alias** | **Description**                                                                                 |
| ------------------ | :--------------: | ----------------------------------------------------------------------------------------------- |
| `--scope <string>` |       `-s`       | default scope for the newly created component                                                   |
| `--path <string>`  |       `-p`       | relative path in the workspace. by default the path is `<scope>/<namespace>/<name>`             |
| `--refactor`       |       `-r`       | change the source code of all components using the original component with the new package-name |

---

## format

**Workspace only**: yes  
**Description**: format components in the development workspace

`bit format [component...]`

| **Option**  | **Option alias** | **Description**                                                              |
| ----------- | :--------------: | ---------------------------------------------------------------------------- |
| `--changed` |       `-c`       | format only new and modified components                                      |
| `--check`   |                  | will output a human-friendly message and a list of unformatted files, if any |
| `--json`    |       `-j`       | return the format results in json format                                     |

---

## globals

**Workspace only**: yes  
**Description**: list all globals

`bit globals`

| **Option** | **Option alias** | **Description** |
| ---------- | :--------------: | --------------- |
| `--json`   |       `-j`       | json format     |

---

## graph

**Workspace only**: yes  
**Description**: EXPERIMENTAL. generate an image file with the dependencies graph

`bit graph [id]`

| **Option**              | **Option alias** | **Description**                                                                                        |
| ----------------------- | :--------------: | ------------------------------------------------------------------------------------------------------ |
| `--image <image>`       |       `-i`       | image path. use one of the following extensions: [gif, png, svg, pdf]                                  |
| `--remote [remoteName]` |       `-r`       | remote name (name is optional, leave empty when id is specified)                                       |
| `--all-versions`        |                  | enter all components versions into the graph, not only latest                                          |
| `--layout <name>`       |                  | GraphVis layout. default to "dot". options are [circo, dot, fdp, neato, osage, patchwork, sfdp, twopi] |

---

## help

**Alias**: `$0`  
**Workspace only**: yes  
**Description**: shows help

`bit help`

---

## import

**Workspace only**: yes  
**Description**: import components into your current workspace.  
https://bit.dev/reference/components/importing-components  
you can use a pattern for multiple ids, such as bit import "utils/\*". (wrap the pattern with quotes to avoid collision with shell commands)

`bit import [ids...]`

| **Option**                       | **Option alias** | **Description**                                                                                                                 |
| -------------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------------------------------- |
| `--path <path>`                  |       `-p`       | import components into a specific directory                                                                                     |
| `--objects`                      |       `-o`       | import components objects only, don't write the components to the file system. This is a default behavior for import with no id |
| `--display-dependencies`         |       `-d`       | display the imported dependencies                                                                                               |
| `--override`                     |       `-O`       | override local changes                                                                                                          |
| `--verbose`                      |       `-v`       | showing verbose output for inspection                                                                                           |
| `--json`                         |       `-j`       | return the output as JSON                                                                                                       |
| `--conf`                         |                  | write the configuration file (component.json) of the component (harmony components only)                                        |
| `--skip-npm-install`             |                  | DEPRECATED. use "--skip-dependency-installation" instead                                                                        |
| `--skip-dependency-installation` |                  | do not install packages of the imported components                                                                              |
| `--merge [strategy]`             |       `-m`       | merge local changes with the imported version. strategy should be "theirs", "ours" or "manual"                                  |
| `--dependencies`                 |                  | EXPERIMENTAL. import all dependencies and write them to the workspace                                                           |
| `--dependents`                   |                  | EXPERIMENTAL. import component dependents to allow auto-tag updating them upon tag                                              |
| `--skip-lane`                    |                  | EXPERIMENTAL. when checked out to a lane, do not import the component into the lane, save it on main                            |
| `--all-history`                  |                  | relevant for fetching all components objects. avoid optimizations, fetch all history versions, always                           |

---

## init

**Workspace only**: no  
**Description**: initialize an empty bit scope  
https://bit.dev/reference/workspace/creating-workspaces#initialize-a-workspace-on-an-existing-project

`bit init [path]`

| **Option**                                | **Option alias** | **Description**                                                                                                                        |
| ----------------------------------------- | :--------------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--bare [name]`                           |       `-b`       | initialize an empty bit bare scope                                                                                                     |
| `--shared <groupname>`                    |       `-s`       | add group write permissions to a scope properly                                                                                        |
| `--standalone`                            |       `-T`       | do not nest component store within .git directory and do not write config data inside package.json                                     |
| `--reset`                                 |       `-r`       | write missing or damaged Bit files                                                                                                     |
| `--reset-new`                             |                  | reset .bitmap file as if the components were newly added and remove all model data (objects)                                           |
| `--reset-hard`                            |                  | delete all Bit files and directories, including Bit configuration, tracking and model data. Useful for re-start using Bit from scratch |
| `--default-directory <default-directory>` |       `-d`       | set up default directory to import components into                                                                                     |
| `--package-manager <package-manager>`     |       `-p`       | set up package manager (npm or yarn)                                                                                                   |
| `--force`                                 |       `-f`       | force workspace initialization without clearing local objects                                                                          |
| `--harmony`                               |                  | DEPRECATED. no need for this flag. Harmony is the default now                                                                          |
| `--interactive`                           |       `-I`       | EXPERIMENTAL. start an interactive process                                                                                             |

---

## install

**Alias**: `in`  
**Workspace only**: yes  
**Description**: install development workspace dependencies

`bit install [packages...]`

| **Option**                              | **Option alias** | **Description**                                                 |
| --------------------------------------- | :--------------: | --------------------------------------------------------------- |
| `--variants <variants>`                 |       `-v`       | add packages to specific variants                               |
| `--type [lifecycleType]`                |       `-t`       | "runtime" (default) or "peer" (dev is not a valid option)       |
| `--update-existing [updateExisting]`    |       `-u`       | update existing dependencies version and types                  |
| `--save-prefix [savePrefix]`            |                  | set the prefix to use when adding dependency to workspace.jsonc |
| `--skip-dedupe [skipDedupe]`            |                  | do not dedupe dependencies on installation                      |
| `--skip-import [skipImport]`            |                  | do not import bit objects post installation                     |
| `--add-missing-peers [addMissingPeers]` |                  | install all missing peer dependencies                           |

---

## link

**Workspace only**: yes  
**Description**: generate symlinks to resolve module paths for imported components.  
https://bit.dev/reference/workspace/component-links

`bit link [ids...]`

| **Option**                | **Option alias** | **Description**                                                                                                |
| ------------------------- | :--------------: | -------------------------------------------------------------------------------------------------------------- |
| `--json`                  |       `-j`       | return the output as JSON                                                                                      |
| `--verbose`               |                  | verbose output                                                                                                 |
| `--rewire`                |       `-r`       | Replace relative paths with module paths in code (e.g. "../foo" => "@bit/foo")                                 |
| `--target <dir>`          |                  | EXPERIMENTAL. link to an external directory (similar to npm-link) so other projects could use these components |
| `--skip-fetching-objects` |                  | skip fetch missing objects from remotes before linking                                                         |

---

## lint

**Workspace only**: yes  
**Description**: lint components in the development workspace

`bit lint [component...]`

| **Option**             | **Option alias** | **Description**                                                   |
| ---------------------- | :--------------: | ----------------------------------------------------------------- |
| `--changed`            |       `-c`       | lint only new and modified components                             |
| `--fix`                |       `-f`       | automatically fix problems                                        |
| `--fix-type <fixType>` |                  | specify the types of fixes to apply (problem, suggestion, layout) |
| `--json`               |       `-j`       | return the lint results in json format                            |

---

## list

**Alias**: `ls`  
**Workspace only**: no  
**Description**: list components on a local or a remote scope.  
 https://bit.dev/reference/reference/cli-reference#list

`bit list [remote-scope]`

| **Option**             | **Option alias** | **Description**                                                                 |
| ---------------------- | :--------------: | ------------------------------------------------------------------------------- |
| `--ids`                |       `-i`       | show only component ids unformatted                                             |
| `--scope`              |       `-s`       | show only components stored in the local scope, including indirect dependencies |
| `--bare`               |       `-b`       | DEPRECATED. use --raw instead                                                   |
| `--raw`                |       `-r`       | show raw output (only components ids, no styling)                               |
| `--outdated`           |       `-o`       | show latest versions from remotes                                               |
| `--json`               |       `-j`       | show the output in JSON format                                                  |
| `--namespace <string>` |       `-n`       | show only specified namespace by using wildcards                                |

---

## log

**Workspace only**: no  
**Description**: show components(s) tag history.  
 https://bit.dev/reference/reference/cli-reference#log

`bit log <id>`

| **Option**  | **Option alias** | **Description**                           |
| ----------- | :--------------: | ----------------------------------------- |
| `--remote`  |       `-r`       | show log of a remote component            |
| `--parents` |                  | EXPERIMENTAL. show parents and lanes data |

---

## login

**Workspace only**: no  
**Description**: log the CLI into Bit Cloud

`bit login`

| **Option**                  | **Option alias** | **Description**                                                                                    |
| --------------------------- | :--------------: | -------------------------------------------------------------------------------------------------- |
| `--port <port>`             |       `-p`       | port number to open for localhost server (default 8085)                                            |
| `--suppress-browser-launch` |                  | do not open a browser for authentication                                                           |
| `--npmrc-path <path>`       |                  | path to npmrc file to configure bit.cloud registry                                                 |
| `--skip-registry-config`    |                  | don't configure bit.cloud registry                                                                 |
| `--machine-name <string>`   |                  | specify machine-name to pair with the token (useful for CI to avoid accidentally revoke the token) |

---

## logout

**Workspace only**: yes  
**Description**: log the CLI out of Bit

`bit logout`

---

## merge

**Workspace only**: yes  
**Description**: merge changes of different component versions  
 `bit merge <version> [ids...]` => merge changes of the given version into the checked out version  
 `bit merge [ids...]` => EXPERIMENTAL. merge changes of the remote head into local, optionally use '--abort' or '--resolve'  
 you can use a pattern for multiple ids, such as bit merge 0.0.1 "utils/\*". (wrap the pattern with quotes to avoid collision with shell commands)

`bit merge [values...]`

| **Option**            | **Option alias** | **Description**                                                                             |
| --------------------- | :--------------: | ------------------------------------------------------------------------------------------- |
| `--ours`              |                  | in case of a conflict, override the used version with the current modification              |
| `--theirs`            |                  | in case of a conflict, override the current modification with the specified version         |
| `--manual`            |                  | in case of a conflict, leave the files with a conflict state to resolve them manually later |
| `--abort`             |                  | EXPERIMENTAL. in case of an unresolved merge, revert to the state before the merge began    |
| `--resolve`           |                  | EXPERIMENTAL. mark an unresolved merge as resolved and create a new snap with the changes   |
| `--no-snap`           |                  | EXPERIMENTAL. do not auto snap in case the merge completed without conflicts                |
| `--build`             |                  | in case of snap during the merge, run the build-pipeline (similar to bit snap --build)      |
| `--message <message>` |       `-m`       | EXPERIMENTAL. override the default message for the auto snap                                |

---

## move

**Alias**: `mv`  
**Workspace only**: yes  
**Description**: move files or directories of component(s)  
 https://bit.dev/reference/workspace/moving-components

`bit move <existing-dir> <new-dir>`

| **Option**    | **Option alias** | **Description**                                                                                                              |
| ------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------- |
| `--component` |       `-c`       | move component files that are spread over multiple directories to one directory. synopsis: `move <component-id> <directory>` |

---

## new

**Workspace only**: yes  
**Description**: Create a new workspace from a template

`bit new <templateName> <workspaceName>`

| **Option**                 | **Option alias** | **Description**                                                                                                 |
| -------------------------- | :--------------: | --------------------------------------------------------------------------------------------------------------- |
| `--aspect <string>`        |       `-a`       | aspect-id of the template. mandatory for non-core aspects. helpful for core aspects in case of a name collision |
| `--default-scope <string>` |       `-d`       | set defaultScope in the new workspace.jsonc                                                                     |
| `--standalone`             |                  | DEPRECATED. use --skip-git instead                                                                              |
| `--skip-git`               |       `-s`       | skip generation of Git repository                                                                               |
| `--empty`                  |       `-e`       | empty workspace with no components (relevant for templates that add components by default)                      |
| `--load-from <string>`     |                  | path to the workspace containing the template. helpful during a development of a workspace-template             |

---

## pack

**Workspace only**: yes  
**Description**: create tar for npm publish

`bit pack <componentId> [scopePath]`

| **Option**            | **Option alias** | **Description**                                    |
| --------------------- | :--------------: | -------------------------------------------------- |
| `--out-dir <out-dir>` |       `-d`       | directory to put the result tar file               |
| `--override`          |       `-o`       | override existing pack file                        |
| `--keep`              |       `-k`       | should keep isolated environment [default = false] |
| `--prefix`            |       `-p`       | keep custom (binding) prefix                       |
| `--json`              |       `-j`       | return the output as JSON                          |

---

## pattern

**Workspace only**: yes  
**Description**: list the component ids matching the given pattern

`bit pattern <pattern>`

| **Option** | **Option alias** | **Description**           |
| ---------- | :--------------: | ------------------------- |
| `--json`   |       `-j`       | return the output as JSON |

---

## refactor

**Workspace only**: yes  
**Description**: EXPERIMENTAL. source code refactoring / codemod

`bit refactor <sub-command>`

### refactor dependency-name

**Usage**: `refactor dependency-name <old-id> <new-id>`

**Description**: replace the dependency's old package-name with a new one in the code  
the `<old-id>` and `<new-id>` arguments can be either a component-id or a package-name.

---

## remote

**Workspace only**: yes  
**Description**: manage set of tracked bit scope(s)  
 https://bit.dev/reference/scope/remote-scopes

`bit remote`

### remote add

**Usage**: `remote add <url>`

**Description**: add a bare-scope as a remote. supported protocols are [file, http, ssh].  
for example: "http://localhost:3000", "file:///tmp/local-scope", "ssh://user@127.0.0.1:/tmp/local-scope".  
Legacy support [file, ssh]. Harmony supports [file, http].

| **Option** | **Option alias** | **Description**              |
| ---------- | :--------------: | ---------------------------- |
| `--global` |       `-g`       | configure a remote bit scope |

### remote del

**Usage**: `remote del <name>`

**Description**: remove a tracked bit remote

| **Option** | **Option alias** | **Description**                         |
| ---------- | :--------------: | --------------------------------------- |
| `--global` |       `-g`       | remove a global configured remote scope |

| **Option** | **Option alias** | **Description**                 |
| ---------- | :--------------: | ------------------------------- |
| `--global` |       `-g`       | see globally configured remotes |

---

## remove

**Alias**: `rm`  
**Workspace only**: no  
**Description**: remove a component (local/remote)  
 https://bit.dev/reference/components/removing-components  
 you can use a pattern for multiple ids, such as bit remove "utils/\*". (wrap the pattern with quotes to avoid collision with shell commands)

`bit remove <ids...>`

| **Option**       | **Option alias** | **Description**                                                                                                                    |
| ---------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------- |
| `--remote`       |       `-r`       | remove a component from a remote scope                                                                                             |
| `--track`        |       `-t`       | keep tracking component (default = false)                                                                                          |
| `--delete-files` |       `-d`       | delete local component files (authored components only. for imported components the files are always deleted)                      |
| `--force`        |       `-f`       | removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt |
| `--silent`       |       `-s`       | skip confirmation                                                                                                                  |

---

## rename

**Workspace only**: no  
**Description**: EXPERIMENTAL. rename component. if tagged/exported, create a new component and deprecate the source-component  
the `<target-name>` should include the component-name only, without the scope-name.  
to assign a default-scope to this component, please use "--scope" flag

`bit rename <source-name> <target-name>`

| **Option**         | **Option alias** | **Description**                                                                         |
| ------------------ | :--------------: | --------------------------------------------------------------------------------------- |
| `--scope <string>` |       `-s`       | default scope for the newly created component                                           |
| `--path <string>`  |       `-p`       | relative path in the workspace. by default the path is `<scope>/<namespace>/<name>`     |
| `--refactor`       |       `-r`       | change the source code of all components using this component with the new package-name |

---

## resume-export

**Workspace only**: yes  
**Description**: resume failed export to persist the pending objects on the given remotes.  
the export-id is the id the client got in the error message during the failure.  
alternatively, exporting to any one of the failed scopes, throws server-is-busy error with the export-id

`bit resume-export <export-id> <remotes...>`

---

## run

**Alias**: `c`  
**Workspace only**: yes  
**Description**: run an application

`bit run <app>`

| **Option**     | **Option alias** | **Description**                                                            |
| -------------- | :--------------: | -------------------------------------------------------------------------- |
| `--dev`        |       `-d`       | start the application in dev mode.                                         |
| `--verbose`    |       `-v`       | showing verbose output for inspection and prints stack trace               |
| `--skip-watch` |                  | avoid running the watch process that compiles components in the background |

---

## schema

**Workspace only**: yes  
**Description**: shows the API schema of a certain component.

`bit schema <id>`

| **Option** | **Option alias** | **Description**                          |
| ---------- | :--------------: | ---------------------------------------- |
| `--json`   |       `-j`       | return the component data in json format |

---

## scope-config

**Workspace only**: yes  
**Description**: scope config management

`bit scope-config`

### scope-config set

**Usage**: `scope-config set <key> <val>`

**Description**: set a scope configuration

### scope-config del

**Usage**: `scope-config del <key>`

**Description**: delete given key from global configuration

### scope-config get

**Usage**: `scope-config get <key>`

**Description**: get a scope configuration

### scope-config list

**Usage**: `scope-config list`

**Description**: list all scope configuration(s)

---

## show

**Workspace only**: yes  
**Description**: show a component

`bit show <id>`

| **Option**  | **Option alias** | **Description**                                                                                          |
| ----------- | :--------------: | -------------------------------------------------------------------------------------------------------- |
| `--json`    |       `-j`       | return the component data in json format                                                                 |
| `--legacy`  |       `-l`       | use the legacy bit show.                                                                                 |
| `--remote`  |       `-r`       | show a remote component                                                                                  |
| `--compare` |       `-c`       | compare current file system component to latest tagged component [default=latest]. only works in legacy. |

---

## start

**Alias**: `c`  
**Workspace only**: yes  
**Description**: Start a dev environment for a workspace or a specific component

`bit start [type] [pattern]`

| **Option**           | **Option alias** | **Description**                                              |
| -------------------- | :--------------: | ------------------------------------------------------------ |
| `--dev`              |       `-d`       | start UI server in dev mode.                                 |
| `--port [number]`    |       `-p`       | port of the UI server.                                       |
| `--rebuild`          |       `-r`       | rebuild the UI                                               |
| `--verbose`          |       `-v`       | showing verbose output for inspection and prints stack trace |
| `--no-browser`       |                  | do not automatically open browser when ready                 |
| `--skip-compilation` |                  | skip the auto-compilation before starting the web-server     |

---

## status

**Alias**: `s`  
**Workspace only**: yes  
**Description**: show the working area component(s) status.  
 https://bit.dev/reference/workspace/workspace-status

`bit status`

| **Option** | **Option alias** | **Description**                        |
| ---------- | :--------------: | -------------------------------------- |
| `--json`   |       `-j`       | return a json version of the component |
| `--strict` |                  | in case issues found, exit with code 1 |

---

## tag

**Alias**: `t`  
**Workspace only**: yes  
**Description**: record component changes and lock versions.  
if no ids are provided, it will tag all new and modified components.  
if component ids are entered, you can specify a version per id using "@" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major  
https://bit.dev/reference/components/tags  
you can use a pattern for multiple ids, such as bit tag "utils/\*". (wrap the pattern with quotes to avoid collision with shell commands)

`bit tag [id...]`

| **Option**                   | **Option alias** | **Description**                                                                                                         |
| ---------------------------- | :--------------: | ----------------------------------------------------------------------------------------------------------------------- |
| `--message <message>`        |       `-m`       | log message describing the user changes                                                                                 |
| `--unmodified`               |                  | include unmodified components (by default, only new and modified components are tagged)                                 |
| `--editor [editor]`          |                  | EXPERIMENTAL. open an editor to edit the tag messages per component, optionally specify the editor-name, default to vim |
| `--ver <version>`            |       `-v`       | tag with the given version                                                                                              |
| `--patch`                    |       `-p`       | increment the patch version number                                                                                      |
| `--minor`                    |                  | increment the minor version number                                                                                      |
| `--major`                    |                  | increment the major version number                                                                                      |
| `--snapped`                  |                  | tag components that their head is a snap (not a tag)                                                                    |
| `--pre-release [identifier]` |                  | EXPERIMENTAL. increment a pre-release version (e.g. 1.0.0-dev.1)                                                        |
| `--skip-tests`               |                  | skip running component tests during tag process                                                                         |
| `--skip-auto-tag`            |                  | skip auto tagging dependents                                                                                            |
| `--soft`                     |                  | do not persist. only keep note of the changes to be made                                                                |
| `--persist`                  |                  | persist the changes generated by --soft tag                                                                             |
| `--disable-tag-pipeline`     |                  | skip the tag pipeline to avoid publishing the components                                                                |
| `--force-deploy`             |                  | run the tag pipeline although the build failed                                                                          |
| `--increment-by <number>`    |                  | (default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.              |
| `--ignore-issues [issues]`   |       `-i`       | ignore component issues (shown in "bit status" as "issues found"), issues to ignore:                                    |

[MissingPackagesDependenciesOnFs, MissingComponents, UntrackedDependencies, ResolveErrors, RelativeComponents, RelativeComponentsAuthored, ParseErrors, MissingLinks, MissingDists, LegacyInsideHarmony, MissingDependenciesOnFs, MissingCustomModuleResolutionLinks, ImportNonMainFiles, CustomModuleResolutionUsed, MultipleEnvs, MissingLinksFromNodeModulesToSrc, CircularDependencies]
to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "\*".|
|`--ignore-newest-version`|`-I`|ignore existing of newer versions (default = false)|
|`--build`|`-b`|EXPERIMENTAL. not needed for now. run the pipeline build and complete the tag|
|`--all [version]`|`-a`|DEPRECATED (not needed anymore, it is the default now). tag all new and modified components|
|`--scope [version]`|`-s`|DEPRECATED (use "--unmodified" instead). tag all components of the current scope|
|`--force`|`-f`|DEPRECATED (use "--skip-tests" or "--unmodified" instead). force-tag even if tests are failing and even when component has not changed|
|`--disable-deploy-pipeline`| |DEPRECATED. use --disable-tag-pipeline instead|

---

## templates

**Workspace only**: yes  
**Description**: list components templates when inside bit-workspace (for bit-create), otherwise, list workspace templates (for bit-new)

`bit templates`

| **Option**   | **Option alias** | **Description**       |
| ------------ | :--------------: | --------------------- |
| `--show-all` |       `-s`       | show hidden templates |

---

## test

**Alias**: `at`  
**Workspace only**: yes  
**Description**: test set of components in your workspace

`bit test [pattern]`

| **Option**           | **Option alias** | **Description**                                                      |
| -------------------- | :--------------: | -------------------------------------------------------------------- |
| `--watch`            |       `-w`       | start the tester in watch mode.                                      |
| `--debug`            |       `-d`       | start the tester in debug mode.                                      |
| `--all`              |       `-a`       | test all components, not only new and modified                       |
| `--junit <filepath>` |                  | write tests results as JUnit XML format into the specified file path |
| `--coverage`         |                  | show code coverage data                                              |
| `--env <id>`         |       `-e`       | test only the given env                                              |
| `--scope <scope>`    |       `-s`       | name of the scope to test                                            |

---

## ui-build

**Alias**: `c`  
**Workspace only**: yes  
**Description**: build production assets for deployment.

`bit ui-build [type]`

---

## undeprecate

**Workspace only**: no  
**Description**: undeprecate a deprecated component (local/remote)

`bit undeprecate <id>`

---

## uninstall

**Alias**: `un`  
**Workspace only**: yes  
**Description**: uninstall dependencies

`bit uninstall [packages...]`

---

## untag

**Workspace only**: yes  
**Description**: revert version(s) tagged for component(s)  
 https://bit.dev/reference/components/tags#undoing-a-tag  
 you can use a pattern for multiple ids, such as bit untag "utils/\*". (wrap the pattern with quotes to avoid collision with shell commands)

`bit untag [id] [version]`

| **Option** | **Option alias** | **Description**                                                                                       |
| ---------- | :--------------: | ----------------------------------------------------------------------------------------------------- |
| `--all`    |       `-a`       | revert tag for all tagged components                                                                  |
| `--soft`   |                  | harmony - revert only soft-tags (components tagged with --soft flag)                                  |
| `--force`  |       `-f`       | revert the tag even if used as a dependency. WARNING: components that depend on this tag will corrupt |

---

## update

**Alias**: `up`  
**Workspace only**: yes  
**Description**: update dependencies

`bit update`

| **Option** | **Option alias** | **Description**                            |
| ---------- | :--------------: | ------------------------------------------ |
| `--yes`    |       `-y`       | automatically update all outdated packages |

---

## use

**Workspace only**: yes  
**Description**: set up aspects in the workspace/scope config

`bit use [ids...]`

---

## watch

**Workspace only**: yes  
**Description**: watch a set of components

`bit watch`

| **Option**               | **Option alias** | **Description**                                                                                                                                   |
| ------------------------ | :--------------: | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--verbose`              |       `-v`       | showing npm verbose output for inspection and prints stack trace                                                                                  |
| `--skip-pre-compilation` |                  | skip the compilation step before starting to watch                                                                                                |
| `--check-types [string]` |       `-t`       | EXPERIMENTAL. show errors/warnings for types. options are [file, project] to investigate only changed file or entire project. defaults to project |

---
